package cn.edu.nju.software.grapheditor.cmd;

import java.awt.Point;

import cn.edu.nju.software.grapheditor.Drawing;
import cn.edu.nju.software.grapheditor.shape.Shape;

/**@author smy*/
//Written on May 21th-22th
public class MoveCmd extends Command{
     private Shape current;
     public void executePress(Point p, Drawing dwg) {
 	     current=dwg.getFrontmostContainer(p);
     }
     public void executeDrag(Point p, Drawing dwg){
    	 current.setCenter(p);
    	 dwg.delshape(current);
    	 dwg.addshape(current);
     }
}
